/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.suli.outHouse.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
* @website https://eladmin.vip
* @description /
* @author WYH
* @date 2024-02-01
**/
@Entity
@Data
@Table(name="orders")
public class Orders implements Serializable {

    @Id
    @Column(name = "`id`")
    @ApiModelProperty(value = "ID")
    private String id;

    @Column(name = "`order_code`")
    @ApiModelProperty(value = "订单编号")
    private String orderCode;

    /**
     * 1=销售随车单，2=转仓随车单，3=销售指令，4=成本中心领用 5=转仓
     */
    @Column(name = "`order_type`")
    @ApiModelProperty(value = "单据类型")
    private Integer orderType;

    @Column(name = "`source_document`")
    @ApiModelProperty(value = "来源单据")
    private String sourceDocument;

    /**
     * 0：未出库，1：正在出库，2：已出库
     */
    @Column(name = "`order_status`")
    @ApiModelProperty(value = "单据状态")
    private Integer orderStatus;

    @Column(name = "`unit_code`")
    @ApiModelProperty(value = "单位")
    private String unitCode;

    @Column(name = "`plan_qty`")
    @ApiModelProperty(value = "计划数量")
    private BigDecimal planQty;

    @Column(name = "`act_qty`")
    @ApiModelProperty(value = "实际数量")
    private BigDecimal actQty;

    @Column(name = "`remark`")
    @ApiModelProperty(value = "备注")
    private String remark;

    @Column(name = "`create_by`")
    @ApiModelProperty(value = "创建者")
    private String createBy;

    @Column(name = "`update_by`")
    @ApiModelProperty(value = "更新者")
    private String updateBy;

    @Column(name = "`create_time`")
    @ApiModelProperty(value = "创建日期")
    private Timestamp createTime;

    @Column(name = "`update_time`")
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    @Column(name = "`lot_code`")
    @ApiModelProperty(value = "批次号")
    private String lotCode;

    @Column(name = "`custom`")
    @ApiModelProperty(value = "客户")
    private String custom;

    @Column(name = "`su_no`")
    @ApiModelProperty(value = "供应商代码")
    private String suNo;

    @Column(name = "`is_send_Sccs`")
    @ApiModelProperty(value = "是否推送至sccs")
    private Integer isSendSccs;
    public void copy(Orders source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
